<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<layuicss/>
</head>
<body>
	<div style="margin: 15px;">
		<form class="layui-form">
			<div class="layui-form-item">
				<label class="layui-form-label">学生账号：</label>
				<div class="layui-input-block" style="width:300px;">
				<input type="text" name="account" autocomplete="off" placeholder="请输入账号" class="layui-input" style="width:80%;" value="">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学生姓名：</label>
				<div class="layui-input-block" style="width:300px;">
				<input type="text" name="name" autocomplete="off" placeholder="请输入姓名" class="layui-input" style="width:80%;" value="">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学院：</label>
				<div class="layui-input-block" style="width: 240px;">
				<select name="dept_id" id="college" lay-filter="collegeS">
					<option value="">请选择学院</option>
					<volist name="college_list" id="co">
					<!--<option value="{$co['id']}" <eq name="co.id" value="$user_dept_id">selected="selected"</eq>>{$co.name}</option>-->
					<option value="{$co['id']}">{$co.name}</option>
					</volist>
				</select> 		
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">专业：</label>
				<div class="layui-input-block" style="width: 240px;">
				<select name="major_id" id="maj" lay-filter="">
					<option value="">请选择专业</option>
				<!--<volist name="major_list" id="ma">-->
  				<!--<option value="{$ma['id']}">{$ma.name}</option>-->
  				<!--</volist>-->
				</select> 		
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">年级：</label>
				<div class="layui-input-block" style="width: 240px;">
				<select name="grade_id" id="gra" lay-filter="grade">
					<option value="">请选择年级</option>
				<volist name="grade_list" id="gr">
  				<option value="{$gr['id']}">{$gr.name}</option>
  				</volist>
				</select> 		
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级：</label>
				<div class="layui-input-block" style="width: 240px;">
				<select name="class_id" id="cla">
					<option value="">请选择班级</option>
				<!--<volist name="class_list" id="cs">-->
  				<!--<option value="{$cs['id']}">{$cs.name}</option>-->
  				<!--</volist>-->
				</select> 		
				</div>
			</div>
			<div class="layui-form-item">
	    		<label class="layui-form-label">性别：</label>
	    		<div class="layui-input-block">
		    	<input type="radio" name="sex" value="1" title="男" checked>
		     	<input type="radio" name="sex" value="0" title="女" >	
	   			</div>
	  		</div>
	  		<div class="layui-form-item">
				<label class="layui-form-label">手机号：</label>
				<div class="layui-input-block" style="width:300px;">
				<input type="text" name="phone" autocomplete="off" placeholder="请输入手机号（可为空）" class="layui-input" style="width:80%;" value="">
				</div>
			</div>
	  		<div class="layui-form-item">
				<label class="layui-form-label">备注：</label>
				<div class="layui-input-block" style="width:300px;">
				<input type="text" name="remarks" autocomplete="off" placeholder="请输入备注（可为空）" class="layui-input" style="width:80%;" value="">
				</div>
			</div>	
	  		<div class="layui-form-item">
   				<label class="layui-form-label">禁用：</label>
				<div class="layui-input-block">
				<input type="checkbox" name="status" lay-skin="switch" lay-text="开启|关闭" value="1" checked="checked">
				 </div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="addsave">保存</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
	<layuijs/>
	<script type="text/javascript">
		var addhandleurl = "{:U('Home/StudentMgr/addStudentHandle')}";
		var afteraddurl = "{:U('Home/StudentMgr/studentList')}";
		var linkselecturl = "{:U('Home/StudentMgr/linkSelect')}";
		var rooturl = "__ROOT__/";
	</script>
	<script type="text/javascript" src="__PUBLIC__/static/js/studentMgr.js"></script>
	<script>
		layui.use(['layer','form','jquery'],function() {
			var layer = layui.layer,
					form = layui.form(),
					$ = layui.jquery;
			form.render();
			//学院专业与班级联动选择
			form.on('select(collegeS)',function() {
				 	var dept_id = $('#college').val();
				 	$.ajax({
				 		url: linkselecturl,
				 		type: 'POST',
				 		data: {'dept_id': dept_id},
				 		dataTpye: 'json',
				 		success: function (data) {
				 			//console.log(data);
				 			$('form').find('select[name=major_id]').html(data.major);
				 			$('form').find('select[name=class_id]').html(data.class);
				 			form.render('select');
				 		}
				 	});
			});
		});
	</script>
</body>
</html>